package mil.af.amc.adpetracker.web.actions;

import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.actions.DispatchAction;

import javax.servlet.http.HttpServletRequest;

/**
 * Please fill in this Javadoc
 *
 * @author Jason Ferguson
 */
public class AbstractDispatchAction extends DispatchAction {


    protected void saveError(HttpServletRequest request, ActionMessage actionMessage) {

        ActionMessages actionMessages = new ActionMessages();
        actionMessages.add(ActionMessages.GLOBAL_MESSAGE, actionMessage);
        addErrors(request, actionMessages);

    }

    protected void saveMessage(HttpServletRequest request, ActionMessage actionMessage) {

        ActionMessages actionMessages = new ActionMessages();
        actionMessages.add(ActionMessages.GLOBAL_MESSAGE, actionMessage);
        addMessages(request, actionMessages);
    }
}
